//
//  MoreViewController.m
//  A_GOGO
//
//  Created by Liuiu on 16/1/18.
//  Copyright © 2016年 www.lanou3g.com. All rights reserved.
//

#import "MoreViewController.h"
#import "UIColor+Wonderful.h"
#import "NetworkHandler.h"
#import "HomeModel.h"
@interface MoreViewController ()
@property (nonatomic, retain)NSMutableArray *arr;
@property (nonatomic, retain)NSDictionary *dic;
@end

@implementation MoreViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    self.navigationItem.title = @"热门排行榜";
    //返回按钮
    UIBarButtonItem *item = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"return"] style:UIBarButtonItemStylePlain target:self action:@selector(fan:)];
    
    self.navigationItem.leftBarButtonItems = @[item];
    self.navigationItem.leftBarButtonItem.tintColor = [UIColor doderBlue];
    
    //开始 WebView
    UIWebView *wv =[[UIWebView alloc]initWithFrame:CGRectMake(0, -37, self.view.frame.size.width, self.view.frame.size.height)];
    wv.backgroundColor =[UIColor whiteColor];
    [self.view addSubview:wv];
    
    NSString *str =@"http://api.sj.2144.cn/mobile/newapp/Newslist";
    [NetworkHandler GETWithURL:str completion:^(id result) {
                 self.arr = result[@"ad_tuijian"];
    
    
        [wv loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:_arr[1][@"url"]]]];}];
    
    
}
- (void)fan:(UIBarButtonItem *)btn
{
    [self.navigationController popToRootViewControllerAnimated:YES];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
